package webEquipeRechercheGwt.client.callback.creation;

import webEquipeRechercheGwt.client.allEntityShowingPanel.AllSeminarPanel;
import webEquipeRechercheGwt.client.factory.WidgetFactory;
import webEquipeRechercheGwt.client.structure.DataShowingPanel;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;

public class CallBackSeminarCreationAndModification implements AsyncCallback<Boolean> {

	private DataShowingPanel mainPanel;
	
	public CallBackSeminarCreationAndModification(DataShowingPanel mainPanel){
		this.mainPanel = mainPanel;
	}

	@Override
	public void onFailure(Throwable caught) {
		// TODO Auto-generated method stub
		HorizontalPanel hp = new HorizontalPanel();
		hp.add(new HTMLPanel(caught.getMessage()));
		mainPanel.setCurrentPanel(hp);
	}

	@Override
	public void onSuccess(Boolean result) {
		AllSeminarPanel panel = WidgetFactory.getAllSeminarPanel(mainPanel);
		mainPanel.setCurrentPanel(panel);
	}

}
